<?php

namespace plugin\admin\app\model;

use Illuminate\Database\Eloquent\SoftDeletes;
use plugin\admin\app\model\Base;
use support\Cache;

class IgnoreGood extends Base
{

    protected $table = 'wa_ignore_goods';


    protected $primaryKey = 'id';

    protected $guarded = [];

    // 获取屏蔽商品数据
    public static function getIgnoreGoods()
    {
        $data = Cache::get('ignore_good',[]);
        if (empty($data)){
            $data = self::pluck('barcode')->toArray();
            Cache::set('ignore_good', $data);
        }
        return $data;
    }

    public static function updateIgnoreGoods()
    {
        $data = self::pluck('barcode')->toArray();
        Cache::set('ignore_good', $data);
    }


    
}
